//
//  ByViewCannotAppointBecauseNotHave.m
//  mijifen_ios
//
//  Created by 朱凯 on 2017/12/12.
//  Copyright © 2017年 itboye. All rights reserved.
//

#import "ByViewCannotAppointBecauseNotHave.h"

@implementation ByViewCannotAppointBecauseNotHave

- (instancetype)init {
    
    if (self = [super init]) {
        
        self.position = JKBombViewTargetPositionMid | JKBombViewOriginPositionTop;
        self.damping = 0.8;
        self.shadowUserInteractionEnabled = false;
        
        [self setupUI];
    }
    return self;
}
- (void)setupUI {
    
    UIView *contentView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH * 0.6, 120)];
    contentView.backgroundColor = [UIColor whiteColor];
    contentView.layer.cornerRadius = 12;
    
    
    UILabel *titleLabel = [[UILabel alloc] init];
    titleLabel.text = @"您还未购买任何套餐\n请购买套餐";
    titleLabel.font = FONT(14);
    titleLabel.textAlignment = NSTextAlignmentCenter;
    titleLabel.textColor = [UIColor blackColor];
    [contentView addSubview:titleLabel];

    UIButton *cancelButton = [UIButton buttonWithType:UIButtonTypeCustom];
    cancelButton.backgroundColor = [UIColor orangeColor];
    [cancelButton setImage:[UIImage imageNamed:@"Index_registration_close"] forState:UIControlStateNormal];
    [cancelButton addTarget:self action:@selector(cancel) forControlEvents:UIControlEventTouchUpInside];
    [contentView addSubview:cancelButton];

    
    
    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.edges.equalTo(contentView);
    }];
    [cancelButton setImageEdgeInsets:UIEdgeInsetsMake(10, 10, 10, 10)];
    [cancelButton mas_makeConstraints:^(MASConstraintMaker *make) {
        make.size.mas_equalTo(CGSizeMake(40, 40));
        make.top.right.equalTo(@0);
    }];
   
    self.contentView = contentView;
}

- (void)cancel {
    
    [self hide];
}

@end
